import request from '@/utils/request'

export function getUserInfo() {
    return request({
        url: '/info/user/user',
        method: 'get',
    })
}

export function execUpdate(newInfo) {
    return request({
        url: '/info/user/update',
        method: 'post',
        data: newInfo
    })
}

export function getReleaseInfo(pageNum, pageSize) {
    return request({
        url: '/info/user/release',
        method: 'get',
        params: { pageNum, pageSize }
    })
}

export function getSellerTrading(pageNum, pageSize) {
    return request({
        url: '/info/user/sell',
        method: 'get',
        params: { pageNum, pageSize }
    })
}

export function getBuyerTrading(pageNum, pageSize) {
    return request({
        url: '/info/user/buy',
        method: 'get',
        params: { pageNum, pageSize }
    })
}

export function getTimeSlotPersonByDate(timeSlotDto) {
    return request({
        url: '/trade/tradeInfo/getTimeSlotPersonByDate',
        method: 'get',
        params: timeSlotDto
    })
}

export function getUserWalletLog() {
    return request({
        url: '/info/memory/userWalletLog',
        method: 'get',
    })
}

export function getElecMeterLog() {
    return request({
        url: '/info/memory/userMeterLog',
        method: 'get',
    })
}

export function getElecMeterInfo() {
    return request({
        url: '/trade/electMeter/getElecMeterInfoPerson',
        method: 'get',
    })
}

export function getMyTradeEChart(isBuyer) {
    return request({
        url: '/trade/tradeInfo/getMyTradeEChart',
        method: 'get',
        params: { isBuyer }
    })
}

export function switchSplitHelp(isSplit) {
    return request({
        url: '/trade/tradeInfo/split',
        method: 'get',
        params: { isSplit }
    })
}
